﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Adex;
using System.Web.Services;

namespace MediaMonitor
{
    public partial class ShareNews : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            int ID =Convert.ToInt32(Request.QueryString["Code"].ToString());
            DataTable dt = SPs.GetNewsAlertById(ID).GetDataSet().Tables[0];
            if (dt.Rows.Count > 0)
            {
                lblMediaTypeName.Text = dt.Rows[0]["MediaTypeName"].ToString();
                lblCalification.Text = dt.Rows[0]["Calification"].ToString();
                lblImportant.Text = dt.Rows[0]["Important"].ToString();
                lblMediaName.Text = dt.Rows[0]["MediaName"].ToString();
                lblNews.Text = dt.Rows[0]["News"].ToString();
                lblRFDate.Text = dt.Rows[0]["RFDate"].ToString();
                lblRFDate2.Text = dt.Rows[0]["RFDate"].ToString();
                lblSectionDescription.Text = dt.Rows[0]["SectionDescription"].ToString();
                lblTitle.Text = dt.Rows[0]["Title"].ToString();
                hdnID.Value = dt.Rows[0]["ID"].ToString();
            }
        }
        [WebMethod]
        public static newsalertpopup1[] getNewsAlert1(string ID)
        {
            DataTable dt = SPs.GetNewsAlertById(Convert.ToInt32(ID.ToString())).GetDataSet().Tables[0];
            List<newsalertpopup1> list = new List<newsalertpopup1>();

            foreach (DataRow row in dt.Rows)
            {
                newsalertpopup1 _names = new newsalertpopup1();
                _names.ID = row["ID"].ToString();
                _names.MediaTypeName = row["MediaTypeName"].ToString();
                _names.MediaName = row["MediaName"].ToString();
                _names.RFDate = row["RFDate"].ToString();
                _names.MediaTypeCode = row["MediaTypeCode"].ToString();
                _names.MediaDescription = row["MediaDescription"].ToString();
                _names.MediaCode = row["MediaCode"].ToString();
                _names.SectionCode = row["SectionCode"].ToString();
                _names.SectionDescription = row["SectionDescription"].ToString();
                _names.PageorHour = row["PageorHour"].ToString();
                _names.Duration = row["Duration"].ToString();
                _names.Advertiser = row["Advertiser"].ToString();
                _names.Title = row["Title"].ToString();
                _names.Calification = row["Calification"].ToString();
                _names.Important = row["Important"].ToString();
                _names.OthersBrandsDnvolved = row["OthersBrandsDnvolved"].ToString();
                _names.OthersPeoplesInvolved = row["OthersPeoplesInvolved"].ToString();
                _names.Link = row["Link"].ToString();
                _names.ImageAudioVideoName = row["ImageAudioVideoName"].ToString();
                _names.News = row["News"].ToString();
                _names.Company = row["Company"].ToString();
              
                list.Add(_names);
            }
            return list.ToArray();
        }
    }
      
 public class newsalertpopup1
    {
        public newsalertpopup1()
        {
            //
            // TODO: Add constructor logic here
            //
        }
        private string _MediaTypeName;
        private string _MediaName;
        private string _MediaTypeCode;
        private string _ID;
        private string _MediaCode;
        private string _RFDate;
        private string _MediaDescription;
        private string _SectionCode;
        private string _SectionDescription;
        private string _PageorHour;
        private string _Duration;
        private string _Advertiser;
        private string _Title;
        private string _Calification;
        private string _Important;
        private string _NewsSummary;
        private string _OthersBrandsDnvolved;
        private string _OthersPeoplesInvolved; private string _Link;
        private string _ImageAudioVideoName;
        private string _News;
        private string _Company;
        private string _Totalrecord;
        public string Summary { get; set; }
        public string Totalrecord {
            get { return _Totalrecord; }
            set { _Totalrecord =value; }
        }

        public string MediaTypeName
        {
            set { _MediaTypeName = value; }
            get { return _MediaTypeName; }
        }
        public string MediaName
        {
            set { _MediaName = value; }
            get { return _MediaName; }
        }
        public string MediaTypeCode
        {
            set { _MediaTypeCode = value; }
            get { return _MediaTypeCode; }
        }
        public string ID
        {
            set { _ID = value; }
            get { return _ID; }
        }
        public string MediaCode
        {
            set { _MediaCode = value; }
            get { return _MediaCode; }
        }
        public string RFDate
        {
            set { _RFDate = value; }
            get { return _RFDate; }
        }
        public string MediaDescription
        {
            set { _MediaDescription = value; }
            get { return _MediaDescription; }
        }
        public string SectionCode
        {
            set { _SectionCode = value; }
            get { return _SectionCode; }
        }
        public string SectionDescription
        {
            set { _SectionDescription = value; }
            get { return _SectionDescription; }
        }
        public string PageorHour
        {
            set { _PageorHour = value; }
            get { return _PageorHour; }
        }
        public string Duration
        {
            set { _Duration = value; }
            get { return _Duration; }
        }
        public string Advertiser
        {
            set { _Advertiser = value; }
            get { return _Advertiser; }
        }
        public string Title
        {
            set { _Title = value; }
            get { return _Title; }
        }
        public string Calification
        {
            set { _Calification = value; }
            get { return _Calification; }
        }
        public string Important
        {
            set { _Important = value; }
            get { return _Important; }
        }
        public string NewsSummary
        {
            set { _NewsSummary = value; }
            get { return _NewsSummary; }
        }
        public string OthersBrandsDnvolved
        {
            set { _OthersBrandsDnvolved = value; }
            get { return _OthersBrandsDnvolved; }
        }
        public string OthersPeoplesInvolved
        {
            set { _OthersPeoplesInvolved = value; }
            get { return _OthersPeoplesInvolved; }
        }
        public string Link
        {
            set { _Link = value; }
            get { return _Link; }
        }
        public string ImageAudioVideoName
        {
            set { _ImageAudioVideoName = value; }
            get { return _ImageAudioVideoName; }
        }
        public string News
        {
            set { _News = value; }
            get { return _News; }
        }
        public string Company
        {
            set { _Company = value; }
            get { return _Company; }
        }
    }
}